/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jjsoft.celularessuc.gco.mdl;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Johnny
 */
@Entity
@Table(name = "deuda_cliente_abono", catalog = "celularessuccom", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DeudaClienteAbono.findAll", query = "SELECT d FROM DeudaClienteAbono d"),
    @NamedQuery(name = "DeudaClienteAbono.findByIdAbono", query = "SELECT d FROM DeudaClienteAbono d WHERE d.idAbono = :idAbono"),
    @NamedQuery(name = "DeudaClienteAbono.findByAbono", query = "SELECT d FROM DeudaClienteAbono d WHERE d.abono = :abono"),
    @NamedQuery(name = "DeudaClienteAbono.findByFecha", query = "SELECT d FROM DeudaClienteAbono d WHERE d.fecha = :fecha"),
    @NamedQuery(name = "DeudaClienteAbono.findByDescripcion", query = "SELECT d FROM DeudaClienteAbono d WHERE d.descripcion = :descripcion")})
public class DeudaClienteAbono implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_abono", nullable = false)
    private Integer idAbono;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(precision = 17, scale = 17)
    private Double abono;
    @Column(length = 15)
    private String fecha;
    @Column(length = 200)
    private String descripcion;
    @JoinColumn(name = "id_deuda", referencedColumnName = "id_deuda")
    @ManyToOne
    private DeudaCliente idDeuda;
    @JoinColumn(name = "nick_usuario", referencedColumnName = "nick")
    @ManyToOne
    private Usuario nickUsuario;

    public DeudaClienteAbono() {
    }

    public DeudaClienteAbono(Integer idAbono) {
        this.idAbono = idAbono;
    }

    public Integer getIdAbono() {
        return idAbono;
    }

    public void setIdAbono(Integer idAbono) {
        this.idAbono = idAbono;
    }

    public Double getAbono() {
        return abono;
    }

    public void setAbono(Double abono) {
        this.abono = abono;
    }

    public String getFecha() {
        return fecha;
    }

    public void setFecha(String fecha) {
        this.fecha = fecha;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public DeudaCliente getIdDeuda() {
        return idDeuda;
    }

    public void setIdDeuda(DeudaCliente idDeuda) {
        this.idDeuda = idDeuda;
    }

    public Usuario getNickUsuario() {
        return nickUsuario;
    }

    public void setNickUsuario(Usuario nickUsuario) {
        this.nickUsuario = nickUsuario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAbono != null ? idAbono.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DeudaClienteAbono)) {
            return false;
        }
        DeudaClienteAbono other = (DeudaClienteAbono) object;
        if ((this.idAbono == null && other.idAbono != null) || (this.idAbono != null && !this.idAbono.equals(other.idAbono))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jjsoft.celularessuc.gco.mdl.DeudaClienteAbono[ idAbono=" + idAbono + " ]";
    }
    
}
